{extends file='layout/front.html'}

{block name='headApend'}
<script type="text/javascript" charset="utf-8">
$('.menu1').attr('class', 'menu1_cur');
</script>
<link href="{$config_site_url}style/weibo.css" rel="stylesheet" type="text/css">
<link href="{$config_site_url}style/fixed.css" rel="stylesheet" type="text/css">
{/block}

{block name='main'}
<script type="text/javascript" charset="utf-8" src="{$config_site_url}js/weibo.js"></script>

<div class="main_fixed">

		<div class="main_t3"></div>
		<div class="acct_info">
			<div class="acct_info_img"><a href="weibo/{$data.id}.html"><img src="{$data.profile_image_url}" width="100" height="100" ></a></div>
			<dl class="acct_info_con">
				<dt>{$data.screen_name}</dt>
				<dd class="m">{$data.location}</dd>
				<!--<dd class="w">北京 朝阳区</dd>-->
				<dd><span class="mr20">关注：{$data.friends_count}</span><span class="mr20">粉丝：{$data.followers_count}</span><span class="mr20">微博：{$data.statuses_count}</span></dd>
				<dd>
				<a href="#" class="fr" onclick="tweet_box('@{$data.screen_name}');return false;">@他</a>
				<a class="follow_btn" href="#" action-data="{$data.id}">加关注</a>
				</dd>
			</dl>
		</div>
		<div class="main_t2">
			<ul class="main_min_tab">
				<li><a href="#" class="current"><span>微博</span></a></li>
				<li><a href="#"><span>粉丝</span></a></li>
				<li><a href="#"><span>关注</span></a></li>
			</ul>
		</div>
</div>
        <div class="main_c"> 
			<!--weibo start-->
			<div class="weibo_blk" style="padding:100px 20px">
				<div node-type="feed_list" pagenum="1" class="feed_lists W_linka W_texta" id="weibo_bag">
				</div>
			</div>
			<!--weibo end--> 
		</div>






<script type="text/javascript" charset="utf-8">


  user_id = {$data.id};

  $('.header,.header_user').wrapAll('<div class="header_fixed" />');

	 $('.main_min_tab a').click(function(){
	   var index = $(this).index('.main_min_tab a');
	   $('#weibo_bag').empty();
	   
	   if (index == 0) {
	     friends = 0;
	     followers = 0;
	   } else if (index == 1) {
	     friends = 0;
	     followers = 1;
	   } else if (index == 2) {
	     friends = 1;
	     followers = 0;
	   }

    load_timeline(0, true);
	   $('.main_min_tab a').removeClass('current');
	   $(this).addClass('current');

	   return false;
	 });

   $('.main_min_tab a:eq(0)').click();

  
{if $follow.source.following}
    $('.follow_btn').addClass('follow_btn2').removeClass('follow_btn').html('已关注');
{/if}


$(window).scroll(function(){

  if ($(this).height()+$(this).scrollTop() >= $(document).height()-2) {
    var list = $('dl[action-type=feed_list_item]');
    var pos = $('dl[action-type=feed_list_item]').length - 1;
    var max_id = parseInt($('dl[action-type=feed_list_item]:eq('+pos+')').attr('mid'));
    
    if (max_id) {
        load_timeline(max_id, false);
    }
  }
  // distanceScrollCount = $(this)[0].scrollHeight;
  // distanceScroll = $(this)[0].scrollTop;
  // if(distanceScroll + $(this).height() >= distanceScrollCount) {
  //   alert('1');
    //  if (timeline_lock) {
    //   return false;
    // }
    // var list = $('dl[action-type=feed_list_item]');
    // var pos = $('dl[action-type=feed_list_item]').length - 1;
    // var max_id = parseInt($('dl[action-type=feed_list_item]:eq('+pos+')').attr('mid'));
    // load_timeline(max_id-1);
  //}

});



</script>

{/block}
